//
//  WebViewController.m
//  HeJuBao
//
//  Created by chris on 15/10/29.
//  Copyright (c) 2015年 Chris. All rights reserved.
//

#import "WebViewController.h"
#import "HeConstants.h"
#import "HePreferrence.h"
#import "SessionMgr.h"

@interface WebViewController()

@property (weak, nonatomic) IBOutlet UIWebView *webView;

@end

@implementation WebViewController

-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])
    {
        UIStoryboard* mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        self = [mainStoryboard instantiateViewControllerWithIdentifier:@"WebViewController"];
    }

    return self;
}

//隐藏状态栏
- (BOOL)prefersStatusBarHidden{
    return YES;//隐藏为YES，显示为NO
}

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES animated:YES];
}

-(void)viewDidLoad {
    NSString *str = [NSString stringWithFormat:BaseURL, @"usr/index.html"];
    NSLog(@"str:%@", str);
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:BaseURL, @"usr/index.html"]]];
    [self.webView loadRequest:request];
}

@end
